<template>
    <el-dialog
        title="添加文字"
        :visible.sync="visible"
       
        :before-close="close"
        :append-to-body="true"
       >
        <el-form ref="form">
            <el-form-item label="文字">
                <el-input v-model="text" style="width: 80%;"></el-input>
            </el-form-item>
           
        </el-form>
        <span slot="footer" class="dialog-footer">
            <el-button @click="close">取 消</el-button>
            <el-button type="primary" @click="comfirm">确 定</el-button>
        </span>
        </el-dialog>
</template>
<script>
export default {
    props: {
        visible: {
            type: Boolean,
            default: false
        }
    },
    data(){
        return {
           color: '#000',
            text: ''
        }
    },
    methods: {
        close(){
            this.$emit('close')
        },
        comfirm(){
            this.close()
           

             window.fabricCanvas.addText({
               
                text: this.text
            })
        },
       
    }
}
</script>
<style scoped>

</style>